
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2400. -- Spoj 839 Optimal Marks -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2400: Spoj 839 Optimal Marks</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>135&nbsp;&nbsp;<span class=green>Solved: </span>53<br>[<a href='submitpage.php?id=2400'>Submit</a>][<a href='problemstatus.php?id=2400'>Status</a>][<a href='bbs.php?id=2400'>Discuss</a>]</center><h2>Description</h2><div class=content><div style="text-indent: 21pt" align="left">定义无向图中的一条边的值为：这条边连接的两个点的值的异或值。</div>
<div style="text-indent: 21pt" align="left">定义一个无向图的值为：这个无向图所有边的值的和。</div>
<div style="text-indent: 21pt" align="left">给你一个有<span>n个结点m条边的无向图。其中的一些点的值是给定的，而其余的点的值由你决定（但要求均为非负数），使得这个无向图的值最小。在无向图的值最小的前提下，使得无向图中所有点的值的和最小。</span></div>
<div align="left"><b>&nbsp;</b></div></div><h2>Input</h2><div class=content><div style="text-indent: 21pt" align="left"><span style="color: black">第一行</span><span style="color: black">，</span><span style="color: black">两个数n，m，</span><span style="color: black">表示图的点数和边数</span><span style="color: black">。</span></div>
<div style="text-indent: 21pt" align="left"><span style="color: black">接下来n行</span><span style="color: black">，每行一个数，按编号给出每个点的值（若为负数则表示这个点的值由你决定，值的绝对值大小不超过10^9）。</span></div>
<div style="text-indent: 21pt" align="left"><span style="color: black">接下来m行，每行二个数a，b，表示编号为a与b的两点间连一条边。（保证无重边与自环。）</span></div>
<div style="text-indent: 21pt" align="left">&nbsp;</div></div><h2>Output</h2><div class=content><div align="left"><span style="color: black">&nbsp;&nbsp;&nbsp; </span><span style="color: black">第一行，一个数，表示</span>无向图的值。</div>
<div align="left"><span>&nbsp;&nbsp;&nbsp; </span>第二行，一个数，表示无向图中所有点的值的和。</div>
<div align="left">&nbsp;</div></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>    3 2<br />
    2<br />
    -1<br />
    0<br />
    1 2<br />
    2 3<br />
 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>    2<br />
    2<br />
 <br />
</span></div><h2>HINT</h2>
			<div class=content><p><p>数据约定<br /><br />
&nbsp; n&lt;=500，m&lt;=2000<br /><br />
&nbsp;<br /><br />
样例解释<br /><br />
&nbsp;&nbsp;&nbsp; 2结点的值定为0即可。</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search='></a></p></div><center>[<a href='submitpage.php?id=2400'>Submit</a>][<a href='problemstatus.php?id=2400'>Status</a>][<a href='bbs.php?id=2400'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
